{
    "resourceType": "Bundle",
    "id": "BundleSurgery1Test",
    "meta": {
        "profile": [
            "https://fhir.by/AbstractArea/StructureDefinition/Bundle/MedicationDocument"
        ]
    },
    "identifier": {
        "system": "https://fhir.by/ValueSet/urn:ietf:rfc:3086",
        "value": "{{$guid}}"
    },
    "type": "document",
    "timestamp": "2025-11-18T16:00:00Z",
    "entry": [
        {
            "fullUrl": "Composition/CompositionSurgery1Test",
            "resource": {
                "resourceType": "Composition",
                "id": "CompositionSurgery1Test",
                "meta": {
                    "profile": [
                        "https://fhir.by/StructureDefinition/CompDocument"
                    ]
                },
                "status": "final",
                "type": {
                    "coding": [
                        {
                            "system": "https://fhir.by/ValueSet/CompositionType",
                            "code": "general",
                            "display": "Общая медицинская информация"
                        }
                    ]
                },
                "subject": [
                    {
                        "reference": "Patient/PatientTest"
                    }
                ],
                "date": "2025-11-18T16:00:00Z",
                "author": [
                    {
                        "reference": "Practitioner/{{PractitionerId}}"
                    }
                ],
                "title": "CompDocument для наполненного Bundle по оперативному вмешательству",
                "custodian": {
                    "reference": "Organization/{{OrganizationId}}"
                },
                "event": [
                    {
                        "detail": [
                            {
                                "reference": {
                                    "reference": "Condition/AcuteAppendicitisClinicalTest"
                                }
                            }
                        ]
                    },
                    {
                        "detail": [
                            {
                                "reference": {
                                    "reference": "EpisodeOfCare/ExampleHospitalisation2.2Test"
                                }
                            }
                        ]
                    },
                    {
                        "detail": [
                            {
                                "reference": {
                                    "reference": "Procedure/AppendectomyTest"
                                }
                            }
                        ]
                    }
                ]
            }
        },
        {
            "fullUrl": "Patient/PatientTest",
            "resource": {
                "resourceType": "Patient",
                "id": "PatientTest",
                "meta": {
                    "profile": [
                        "https://fhir.by/StructureDefinition/PatientWithIdentificationNumber"
                    ]
                },
                "extension": [
                    {
                        "extension": [
                            {
                                "url": "https://fhir.by/StructureDefinition/ConsentPersonalDataBoolean",
                                "valueBoolean": true
                            },
                            {
                                "url": "https://fhir.by/StructureDefinition/ConsentPersonalDataPeriod",
                                "valuePeriod": {
                                    "start": "2025-01-01"
                                }
                            }
                        ],
                        "url": "https://fhir.by/StructureDefinition/ConsentPersonalData"
                    }
                ],
                "identifier": [
                    {
                        "use": "usual",
                        "type": {
                            "coding": [
                                {
                                    "system": "https://fhir.by/ValueSet/PersonalDocumentType",
                                    "code": "INP",
                                    "display": "Уникальный идентификационный номер"
                                }
                            ]
                        },
                        "value": "7551029A009PB0"
                    },
                    {
                        "extension": [
                            {
                                "extension": [
                                    {
                                        "url": "https://fhir.by/StructureDefinition/PassportIssuedString",
                                        "valueString": "Центральным РУВД г Минска, 21.08.2021"
                                    },
                                    {
                                        "url": "https://fhir.by/StructureDefinition/PassportIssuedDate",
                                        "valueDate": "2021-08-21"
                                    },
                                    {
                                        "url": "https://fhir.by/StructureDefinition/PassportIssuedCode",
                                        "valueCodeableConcept": {
                                            "coding": [
                                                {
                                                    "system": "https://fhir.by/ValueSet/OCAM",
                                                    "code": "710"
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "url": "https://fhir.by/StructureDefinition/PassportIssued"
                            }
                        ],
                        "use": "usual",
                        "type": {
                            "coding": [
                                {
                                    "system": "https://fhir.by/ValueSet/PersonalDocumentType",
                                    "code": "Passport-RB",
                                    "display": "Паспорт гражданина Республики Беларусь"
                                }
                            ]
                        },
                        "value": "MP2334556"
                    }
                ],
                "active": true,
                "name": [
                    {
                        "family": "Иванов",
                        "given": [
                            "Петр",
                            "Сидорович"
                        ]
                    }
                ],
                "telecom": [
                    {
                        "system": "phone",
                        "value": "375295748410"
                    },
                    {
                        "system": "email",
                        "value": "test_mail@gmail.by"
                    }
                ],
                "gender": "male",
                "birthDate": "1990-12-31",
                "deceasedBoolean": false,
                "address": [
                    {
                        "extension": [
                            {
                                "url": "https://fhir.by/StructureDefinition/CoutryForAddresses",
                                "valueCodeableConcept": {
                                    "coding": [
                                        {
                                            "system": "https://fhir.by/ValueSet/CitizenshipCode",
                                            "code": "BY",
                                            "display": "Беларусь"
                                        }
                                    ]
                                }
                            },
                            {
                                "url": "https://fhir.by/StructureDefinition/StreetGeoRegistry",
                                "valueCodeableConcept": {
                                    "coding": [
                                        {
                                            "system": "https://fhir.by/ValueSet/StreetGeoRegistry",
                                            "code": "5170309411",
                                            "display": "Улица Золотая Горка"
                                        }
                                    ]
                                }
                            },
                            {
                                "url": "https://fhir.by/StructureDefinition/ApartmentRoom",
                                "valueString": "кв. 29"
                            }
                        ],
                        "use": "home",
                        "text": "г.Минск, Улица Золотая Горка, д.5, кв.29",
                        "postalCode": "220022"
                    },
                    {
                        "extension": [
                            {
                                "url": "https://fhir.by/StructureDefinition/CoutryForAddresses",
                                "valueCodeableConcept": {
                                    "coding": [
                                        {
                                            "system": "https://fhir.by/ValueSet/CitizenshipCode",
                                            "code": "BY",
                                            "display": "Беларусь"
                                        }
                                    ]
                                }
                            },
                            {
                                "url": "https://fhir.by/StructureDefinition/StreetGeoRegistry",
                                "valueCodeableConcept": {
                                    "coding": [
                                        {
                                            "system": "https://fhir.by/ValueSet/StreetGeoRegistry",
                                            "code": "51703019678",
                                            "display": "Проспект Рокоссовского"
                                        }
                                    ]
                                }
                            },
                            {
                                "url": "https://fhir.by/StructureDefinition/ApartmentRoom",
                                "valueString": "кв. 2"
                            }
                        ],
                        "use": "temp",
                        "text": "г.Минск, Проспект Рокоссовского, д.20, кв.2",
                        "postalCode": "220011"
                    }
                ],
                "maritalStatus": {
                    "coding": [
                        {
                            "system": "https://fhir.by/ValueSet/MaritalStatus",
                            "code": "married"
                        }
                    ]
                },
                "contact": [
                    {
                        "relationship": [
                            {
                                "coding": [
                                    {
                                        "system": "https://fhir.by/ValueSet/RelatedPersonType",
                                        "code": "wife"
                                    }
                                ]
                            }
                        ],
                        "name": {
                            "family": "Иванова",
                            "given": [
                                "Лариса",
                                "Ивановна"
                            ]
                        },
                        "telecom": [
                            {
                                "system": "phone",
                                "value": "802990990908"
                            }
                        ]
                    }
                ],
                "generalPractitioner": [
                    {
                        "reference": "Organization/365de972-ed7f-453e-8515-865f4c4230c2",
                        "identifier": {
                            "value": "5526",
                            "period": {
                                "start": "2008-12-11"
                            }
                        }
                    }
                ]
            }
        },
        {
            "fullUrl": "EpisodeOfCare/ExampleHospitalisation2.2Test",
            "resource": {
                "resourceType": "EpisodeOfCare",
                "id": "ExampleHospitalisation2.2Test",
                "meta": {
                    "profile": [
                        "https://fhir.by/StructureDefinition/Hospitalisation"
                    ]
                },
                "extension": [
                    {
                        "extension": [
                            {
                                "url": "https://fhir.by/StructureDefinition/TreatmentOutcome",
                                "valueCodeableConcept": {
                                    "coding": [
                                        {
                                            "system": "https://fhir.by/ValueSet/TreatmentOutcome",
                                            "code": "1",
                                            "display": "Перевод в другое отделение"
                                        }
                                    ]
                                }
                            },
                            {
                                "url": "https://fhir.by/StructureDefinition/LocationUnitOfOrganization",
                                "valueReference": {
                                    "reference": "Location/{{LocationId_surgeon}}"
                                }
                            },
                            {
                                "url": "https://fhir.by/StructureDefinition/TreatmentPeriod",
                                "valuePeriod": {
                                    "start": "2025-11-15",
                                    "end": "2025-11-16"
                                }
                            },
                            {
                                "url": "https://fhir.by/StructureDefinition/TreatingPractitioner",
                                "valueReference": {
                                    "reference": "PractitionerRole/{{PractitionerRole_surgeon}}"
                                }
                            },
                            {
                                "url": "https://fhir.by/StructureDefinition/HeadOfUnit",
                                "valueReference": {
                                    "reference": "PractitionerRole/{{PractitionerRole_surgeon}}"
                                }
                            },
                            {
                                "url": "https://fhir.by/StructureDefinition/BedProfiles",
                                "valueCodeableConcept": {
                                    "coding": [
                                        {
                                            "system": "https://fhir.by/ValueSet/BedProfile",
                                            "code": "short-surgical-adult",
                                            "display": "хирургические для взрослых"
                                        }
                                    ]
                                }
                            }
                        ],
                        "url": "https://fhir.by/StructureDefinition/TreatmentInUnit"
                    },
                    {
                        "extension": [
                            {
                                "url": "https://fhir.by/StructureDefinition/TreatmentOutcome",
                                "valueCodeableConcept": {
                                    "coding": [
                                        {
                                            "system": "https://fhir.by/ValueSet/TreatmentOutcome",
                                            "code": "1",
                                            "display": "Перевод в другое отделение"
                                        }
                                    ]
                                }
                            },
                            {
                                "url": "https://fhir.by/StructureDefinition/LocationUnitOfOrganization",
                                "valueReference": {
                                    "reference": "Location/{{LocationId_resuscitator}}"
                                }
                            },
                            {
                                "url": "https://fhir.by/StructureDefinition/TreatmentPeriod",
                                "valuePeriod": {
                                    "start": "2025-11-16",
                                    "end": "2025-11-18"
                                }
                            },
                            {
                                "url": "https://fhir.by/StructureDefinition/TreatingPractitioner",
                                "valueReference": {
                                    "reference": "PractitionerRole/{{PractitionerRole_resuscitator}}"
                                }
                            },
                            {
                                "url": "https://fhir.by/StructureDefinition/HeadOfUnit",
                                "valueReference": {
                                    "reference": "PractitionerRole/{{PractitionerRole_resuscitator}}"
                                }
                            },
                            {
                                "url": "https://fhir.by/StructureDefinition/BedProfiles",
                                "valueCodeableConcept": {
                                    "coding": [
                                        {
                                            "system": "https://fhir.by/ValueSet/BedProfile",
                                            "code": "short-intensive-adult",
                                            "display": "реанимационные для взрослых"
                                        }
                                    ]
                                }
                            }
                        ],
                        "url": "https://fhir.by/StructureDefinition/TreatmentInUnit"
                    },
                    {
                        "extension": [
                            {
                                "url": "https://fhir.by/StructureDefinition/HospitalisationPaidType",
                                "valueCodeableConcept": {
                                    "coding": [
                                        {
                                            "system": "https://fhir.by/ValueSet/HospitalisationPaidType",
                                            "code": "govern",
                                            "display": "за счет бюджетных средств"
                                        }
                                    ]
                                }
                            }
                        ],
                        "url": "https://fhir.by/StructureDefinition/HospitalisationPaid"
                    },
                    {
                        "url": "https://fhir.by/StructureDefinition/EmergencyHospitalisationTerm",
                        "valuePositiveInt": 6
                    },
                    {
                        "url": "https://fhir.by/StructureDefinition/HepatitisBool",
                        "valueBoolean": false
                    },
                    {
                        "url": "https://fhir.by/StructureDefinition/DiagnosisOfSendingOrganisation",
                        "valueReference": {
                            "reference": "Condition/{{preliminaryCondition}}"
                        }
                    },
                    {
                        "url": "https://fhir.by/StructureDefinition/SequenceNumbeHospitalisation",
                        "valuePositiveInt": 1
                    },
                    {
                        "url": "https://fhir.by/StructureDefinition/PreviusResourceHospitalisation",
                        "valueReference": {
                            "reference": "EpisodeOfCare/{{startEpisodeOfCareId}}"
                        }
                    }
                ],
                "identifier": [
                    {
                        "value": "12/1",
                        "assigner": {
                            "reference": "Organization/{{OrganizationId}}"
                        }
                    }
                ],
                "status": "active",
                "type": [
                    {
                        "coding": [
                            {
                                "system": "https://fhir.by/ValueSet/TypeOfHealthCare",
                                "code": "hightechnology",
                                "display": "Высокотехнологичная медицинская помощь"
                            }
                        ]
                    }
                ],
                "reason": [
                    {
                        "use": {
                            "coding": [
                                {
                                    "system": "https://fhir.by/ValueSet/HospitalisationReasonUse",
                                    "code": "2",
                                    "display": "Экстренная госпитализация"
                                }
                            ]
                        },
                        "value": [
                            {
                                "concept": {
                                    "text": "Для уточнения диагноза и лечения"
                                }
                            }
                        ]
                    }
                ],
                "diagnosis": [
                    {
                        "condition": [
                            {
                                "extension": [
                                    {
                                        "url": "https://fhir.by/StructureDefinition/TypeOfDiagnosis",
                                        "valueCodeableConcept": {
                                            "coding": [
                                                {
                                                    "system": "https://fhir.by/ValueSet/TypeOfDiagnosis",
                                                    "code": "mainDiagnosis",
                                                    "display": "Основной диагноз"
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "reference": {
                                    "reference": "Condition/{{preliminaryCondition}}"
                                }
                            }
                        ],
                        "use": {
                            "coding": [
                                {
                                    "system": "https://fhir.by/ValueSet/KindOfDiagnosisCode",
                                    "code": "Preliminary",
                                    "display": "Предварительный диагноз"
                                }
                            ]
                        }
                    },
                    {
                        "condition": [
                            {
                                "extension": [
                                    {
                                        "url": "https://fhir.by/StructureDefinition/TypeOfDiagnosis",
                                        "valueCodeableConcept": {
                                            "coding": [
                                                {
                                                    "system": "https://fhir.by/ValueSet/TypeOfDiagnosis",
                                                    "code": "mainDiagnosis",
                                                    "display": "Основной диагноз"
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "reference": {
                                    "reference": "Condition/AcuteAppendicitisClinicalTest"
                                }
                            }
                        ],
                        "use": {
                            "coding": [
                                {
                                    "system": "https://fhir.by/ValueSet/KindOfDiagnosisCode",
                                    "code": "Clinical",
                                    "display": "Клинический диагноз"
                                }
                            ]
                        }
                    }
                ],
                "patient": {
                    "reference": "Patient/PatientTest"
                },
                "managingOrganization": {
                    "reference": "Organization/{{OrganizationId}}"
                },
                "period": {
                    "start": "2025-11-15"
                },
                "careManager": {
                    "reference": "PractitionerRole/{{PractitionerRole}}"
                }
            }
        },
        {
            "fullUrl": "Condition/AcuteAppendicitisClinicalTest",
            "resource": {
                "resourceType": "Condition",
                "id": "AcuteAppendicitisClinicalTest",
                "meta": {
                    "profile": [
                        "https://fhir.by/StructureDefinition/FinalDiagnosis"
                    ]
                },
                "extension": [
                    {
                        "url": "https://fhir.by/StructureDefinition/KindOfDiagnosis",
                        "valueCodeableConcept": {
                            "coding": [
                                {
                                    "system": "https://fhir.by/ValueSet/KindOfDiagnosisCode",
                                    "code": "Clinical"
                                }
                            ]
                        }
                    },
                    {
                        "url": "https://fhir.by/StructureDefinition/AssertedDate",
                        "valueDateTime": "2025-11-16T15:15:00Z"
                    },
                    {
                        "url": "https://fhir.by/StructureDefinition/CourseOfDisease",
                        "valueCodeableConcept": {
                            "coding": [
                                {
                                    "system": "https://fhir.by/ValueSet/CourseOfDisease",
                                    "code": "acute"
                                }
                            ]
                        }
                    },
                    {
                        "url": "https://fhir.by/StructureDefinition/FirstTimeRevealed",
                        "valueBoolean": true
                    }
                ],
                "clinicalStatus": {
                    "coding": [
                        {
                            "system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
                            "code": "active"
                        }
                    ]
                },
                "code": {
                    "coding": [
                        {
                            "system": "https://fhir.by/ValueSet/InternClassificDiseases10",
                            "code": "K35.3",
                            "display": "K35.3 - Острый аппендицит с ограниченным перитонитом"
                        }
                    ]
                },
                "subject": {
                    "reference": "Patient/PatientTest"
                },
                "onsetDateTime": "2025-11-16",
                "recordedDate": "2025-11-16",
                "participant": [
                    {
                        "actor": {
                            "reference": "PractitionerRole/{{PractitionerRole}}"
                        }
                    }
                ],
                "note": [
                    {
                        "text": "Клинический диагноз. Острый флегмонозный аппендицин. Местный серозно-фибринозный перитонит."
                    }
                ]
            }
        },
        {
            "fullUrl": "Procedure/AppendectomyTest",
            "resource": {
                "resourceType": "Procedure",
                "id": "AppendectomyTest",
                "meta": {
                    "profile": [
                        "https://fhir.by/StructureDefinition/SurgicalProcedure"
                    ]
                },
                "extension": [
                    {
                        "url": "https://fhir.by/StructureDefinition/FromOrganization",
                        "valueReference": {
                            "reference": "Organization/{{OrganizationId}}"
                        }
                    },
                    {
                        "url": "https://fhir.by/StructureDefinition/EncounterTypeOfService",
                        "valueCodeableConcept": {
                            "coding": [
                                {
                                    "system": "https://fhir.by/ValueSet/EncounterTypeOfService",
                                    "code": "free",
                                    "display": "Бесплатные услуги"
                                }
                            ]
                        }
                    },
                    {
                        "url": "https://fhir.by/StructureDefinition/TermsOfService",
                        "valueCodeableConcept": {
                            "coding": [
                                {
                                    "system": "https://fhir.by/ValueSet/VSTermsOfService",
                                    "code": "2",
                                    "display": "стационарные"
                                }
                            ]
                        }
                    },
                    {
                        "url": "https://fhir.by/StructureDefinition/InpatientMedicalRecord",
                        "valueReference": {
                            "reference": "EpisodeOfCare/ExampleHospitalisation2.2Test"
                        }
                    },
                    {
                        "url": "https://fhir.by/StructureDefinition/AnesthesiaType",
                        "valueCodeableConcept": {
                            "coding": [
                                {
                                    "system": "https://fhir.by/ValueSet/AnesthesiaType",
                                    "code": "endotracheal",
                                    "display": "Эндотрахеальный наркоз"
                                }
                            ]
                        }
                    },
                    {
                        "url": "https://fhir.by/StructureDefinition/ProcedureComplexity",
                        "valueCodeableConcept": {
                            "coding": [
                                {
                                    "system": "https://fhir.by/ValueSet/ProcedureComplexity",
                                    "code": "complex",
                                    "display": "Сложное"
                                }
                            ]
                        }
                    },
                    {
                        "url": "https://fhir.by/StructureDefinition/ProcedureUrgency",
                        "valueCodeableConcept": {
                            "coding": [
                                {
                                    "system": "https://fhir.by/ValueSet/ProcedureUrgency",
                                    "code": "emergency",
                                    "display": "Экстренное"
                                }
                            ]
                        }
                    }
                ],
                "identifier": [
                    {
                        "value": "13582",
                        "assigner": {
                            "reference": "Organization/{{OrganizationId}}"
                        }
                    }
                ],
                "status": "completed",
                "category": [
                    {
                        "coding": [
                            {
                                "system": "https://fhir.by/ValueSet/ProcedureType",
                                "code": "radical",
                                "display": "Радикальная"
                            }
                        ]
                    }
                ],
                "code": {
                    "coding": [
                        {
                            "system": "https://fhir.by/ValueSet/SurgicalInterventions",
                            "code": "JESA10",
                            "display": "Аппендэктомия с дренированием брюшной полости"
                        }
                    ],
                    "text": "Аппендэктомия с дренированием брюшной полости"
                },
                "subject": {
                    "reference": "Patient/PatientTest"
                },
                "occurrencePeriod": {
                    "start": "2025-11-16T12:00:00Z",
                    "end": "2025-11-16T13:20:00Z"
                },
                "performer": [
                    {
                        "function": {
                            "coding": [
                                {
                                    "system": "https://fhir.by/ValueSet/OperatingTeam",
                                    "code": "operator",
                                    "display": "врач-хирург оперирующий"
                                }
                            ]
                        },
                        "actor": {
                            "reference": "PractitionerRole/{{PractitionerRole_surgeon}}"
                        },
                        "period": {
                            "start": "2025-11-16T12:00:00Z",
                            "end": "2025-11-16T13:20:00Z"
                        }
                    },
                    {
                        "function": {
                            "coding": [
                                {
                                    "system": "https://fhir.by/ValueSet/OperatingTeam",
                                    "code": "surgical-sister",
                                    "display": "медицинская сестра операционная"
                                }
                            ]
                        },
                        "actor": {
                            "reference": "PractitionerRole/{{PractitionerRole_sister}}"
                        },
                        "period": {
                            "start": "2025-11-16T12:00:00Z",
                            "end": "2025-11-16T13:20:00Z"
                        }
                    },
                    {
                        "function": {
                            "coding": [
                                {
                                    "system": "https://fhir.by/ValueSet/OperatingTeam",
                                    "code": "anesthetist",
                                    "display": "врач-анестезиолог-реаниматолог"
                                }
                            ]
                        },
                        "actor": {
                            "reference": "PractitionerRole/{{PractitionerRole_resuscitator}}"
                        },
                        "period": {
                            "start": "2025-11-16T12:00:00Z",
                            "end": "2025-11-16T13:20:00Z"
                        }
                    }
                ],
                "location": {
                    "reference": "Location/{{LocationId_resuscitator}}"
                },
                "reason": [
                    {
                        "concept": {
                            "coding": [
                                {
                                    "system": "https://fhir.by/ValueSet/SurgicalInterventionDiagnosis",
                                    "code": "postoperative",
                                    "display": "Диагноз после вмешательства"
                                }
                            ]
                        },
                        "reference": {
                            "reference": "Condition/AcuteAppendicitisClinicalTest"
                        }
                    }
                ],
                "note": [
                    {
                        "text": "После обработки операционного поля выполнен срединный лапаротомный доступ. В брюшной полости - мутный экссудат, фибринозные наложения. Выделен и удалён деструктивно изменённый червеобразный отросток. Культя обработана. Произведена санация брюшной полости теплым антисептическим раствором. Отросток направлен на гистологическое исследование. В брюшную полость установлен дренаж (№ DR-111) для контроля экссудата. Рана послойно ушита. Асептическая повязка. Кровопотеря - около 100 мл. Осложнений во время операции не отмечено."
                    }
                ]
            }
        }
    ]
}